package area;

import java.util.List;

public class SumOfEachWidth {
	
	List<Area> areas;
	private double eachWidths =0;
	
	public SumOfEachWidth(List<Area> areas) {
		this.areas = areas;
			
		sumOfEachs();
	}

	
	private void sumOfEachs() {
		CalculatorWidth calculator = new CalculatorWidth();
		for (int i = 0; i < areas.size(); i++) {
			this.eachWidths += calculator.width(areas.get(i).getWidth(), areas.get(i).getHeigh());
		}
		
	}
	
	public double getEachWidths() {
		return eachWidths;
	}

}
